/**
 * 添加设备保养
 * author Forjune
 */
import React, { useEffect } from 'react'
import Plan from '../components/plan'
import KeepAlive from 'react-activation'
import { connect } from 'dva'

function Add({ dispatch, commonAction: { catchObj } }) {
  useEffect(() => {
    dispatch({
      type: 'commonAction/uploadCatch',
      payload: {
        catchObj: {
          deviceUpkeep_add: [true, false]
        }
      }
    })
  }, [dispatch])
  return (
    <KeepAlive name='deviceUpkeep_add' when={catchObj.deviceUpkeep_add}>
      <div className="deviceUpkeep_add">
        <Plan />
      </div>
    </KeepAlive>
  )
}
export default connect(({ commonAction }) => ({
  commonAction
}))(Add)
